<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo1"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<body>

<div class="layui-card">

    <div class="layui-card-header">
        <span class="layui-icon font-s10 color-desc margin-right-5"></span>取消服务权限
        <div class="pull-right">
<!--            <button data-table-id="NoticeTable" class="layui-btn layui-btn-primary  layui-btn-sm" data-modal="/system/user/form" data-height="720px" data-width="800px">-->
<!--                <i class=" layui-icon layui-icon-addition"></i>新建护工</button>-->
        </div>
    </div>

    <div class="layui-card-line"></div>

    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form th:replace="/pcs/porter_permission/canallist_search">

                </form>
                <table id="PorterCanallistTable" data-url="/pcs/porter/permission/canallist" data-target-search="form.form-search"></table>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#PorterCanallistTable').layTable({
                            even: true, height: 'full',where:{orderBy:"verifyStatus:asc,id:desc"},
                            cols: [[
                                {checkbox: true, fixed: true, width: 60},
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'companyName', title: '陪护公司', minWidth: 180, align: 'center'},
                                {field: 'depName', title: '科室', minWidth: 180, align: 'center'},
                                {field: 'canalName', title: '护士长', minWidth: 180, align: 'center'},
                                {field: 'porterName', title: '陪护员姓名', minWidth: 180, align: 'center'},
                                {field: 'canalRemark', title: '取消原因', align: 'center'},
                                {field: 'canalStatus', title: '取消审核状态', align: 'center', templet: function (d) {
                                        if (d.canalStatus == 0) {
                                            return '<span class="layui-font-gray">正常</span>';
                                        } else if (d.canalStatus == 1) {
                                            return '<span class="layui-font-blue">审核中</span>';
                                        } else if (d.canalStatus == 2) {
                                            return '<span class="layui-font-green">已通过</span>';
                                        } else if (d.canalStatus == 3) {
                                            return '<span class="layui-font-red">已驳回('+d.canalBRemark+')</span>';
                                        } else {
                                            return '未知';
                                        }
                                    }},
                                {field: 'canalTime', title: '申请时间', align: 'center', minWidth: 180},
                                {toolbar: '#toolbar', title: '操作', align: 'center', minWidth: 180, fixed: 'right'}
                            ]]
                        });
                    });



                </script>



                <script type="text/html" id="toolbar">
                    {{# if(d.canalStatus == 1){ }}
                    <a class="layui-btn layui-btn-sm" data-event-dbclick   data-action='/pcs/porter/permission/verify?ids={{d.id}}&verifyStatus=4'>通过</a>
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-event-dbclick   data-modal='/pcs/porter/permission/canal?id={{d.id}}&verifyStatus=5'>驳回</a>
                    {{# }else if(d.canalStatus == 2){ }}
                    <a class="layui-btn layui-btn-sm layui-bg-green" >已通过</a>
                    {{# }else if(d.canalStatus == 3){ }}
                    <a class="layui-btn layui-btn-sm layui-bg-gray" >已驳回</a>
                    {{# } }}

                </script>

            </div>
        </div>
    </div>

</div>
</body>
</html>